package com.w7vm.menuweb.managerBean;

import java.util.List;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import com.w7vm.menuweb.entity.FormaPagamentoSy;
import com.w7vm.menuweb.facade.ContratoFacade;
import com.w7vm.menuweb.vo.PlanoVO;

@ManagedBean
@ViewScoped
public class FormaPagamentoMB {
	
	
	@EJB
	private ContratoFacade contratoEJB;

	private List<FormaPagamentoSy> formaPagamentoL = null;

	
	
	
	/*
	 * ================================== METHOD LOAD FORMAPagamento================================================ -
	 * - ENTITY :: FormaPagamentoSy
	 * - FACADE :: ContratoFacade
	 * ==========================================================================================================
	 */

	public List<FormaPagamentoSy> loadFormaPagamento() {
		System.out.println("[Method][loadFormaPagamento]");
		formaPagamentoL = contratoEJB.preparaListaFormasPagamento();
		return formaPagamentoL;
	}

	
	/*
	 * ================================== METHOD LOAD FormaPagamento================================================ -
	 * - ENTITY :: FormaPagamentoSy
	 * - FACADE :: ContratoFacade
	 * ==========================================================================================================
	 */

	public List<FormaPagamentoSy> getFormaPagamentoL() {
		
		if(formaPagamentoL == null){
			loadFormaPagamento();
		}
		return formaPagamentoL;
	}


	public void setFormaPagamentoL(List<FormaPagamentoSy> formaPagamentoL) {
		this.formaPagamentoL = formaPagamentoL;
	}

	
}
